// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   TableTag.java

package com.vandagroup.common.taglib.html;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import org.apache.struts.util.ResponseUtils;

// Referenced classes of package com.vandagroup.common.taglib.html:
//            TrTag

public class TableTag extends TagSupport
{

    protected String type;
    protected String border;
    protected String cellSpacing;
    protected String cellPadding;
    protected String bgColor;
    protected String width;
    protected String height;
    protected String styleClass;
    protected String style;
    protected String borderColor;
    protected String borderColorDark;
    protected String borderColorLight;

    public TableTag()
    {
        type = null;
        border = null;
        cellSpacing = null;
        cellPadding = null;
        bgColor = null;
        width = null;
        height = null;
        styleClass = null;
        style = null;
        borderColor = null;
        borderColorDark = null;
        borderColorLight = null;
    }

    public String getBgColor()
    {
        return bgColor;
    }

    public String getBorder()
    {
        return border;
    }

    public String getBorderColor()
    {
        return borderColor;
    }

    public String getBorderColorDark()
    {
        return borderColorDark;
    }

    public String getBorderColorLight()
    {
        return borderColorLight;
    }

    public String getCellPadding()
    {
        return cellPadding;
    }

    public String getCellSpacing()
    {
        return cellSpacing;
    }

    public String getHeight()
    {
        return height;
    }

    public String getStyleClass()
    {
        return styleClass;
    }

    public String getType()
    {
        return type;
    }

    public String getWidth()
    {
        return width;
    }

    public void setBgColor(String bgColor)
    {
        this.bgColor = bgColor;
    }

    public void setBorder(String border)
    {
        this.border = border;
    }

    public void setBorderColor(String borderColor)
    {
        this.borderColor = borderColor;
    }

    public void setBorderColorDark(String borderColorDark)
    {
        this.borderColorDark = borderColorDark;
    }

    public void setBorderColorLight(String borderColorLight)
    {
        this.borderColorLight = borderColorLight;
    }

    public void setCellPadding(String cellPadding)
    {
        this.cellPadding = cellPadding;
    }

    public void setCellSpacing(String cellSpacing)
    {
        this.cellSpacing = cellSpacing;
    }

    public void setHeight(String height)
    {
        this.height = height;
    }

    public void setStyleClass(String styleClass)
    {
        this.styleClass = styleClass;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public void setWidth(String width)
    {
        this.width = width;
    }

    public String getStyle()
    {
        return style;
    }

    public void setStyle(String style)
    {
        this.style = style;
    }

    public int doStartTag()
        throws JspException
    {
        StringBuffer sb = new StringBuffer("<table");
        TrTag.JiOu = "Ji";
        if(type == null)
        {
            sb.append(border == null ? "" : " border=\"" + border + "\"");
            sb.append(cellSpacing == null ? "" : " cellspacing=\"" + cellSpacing + "\"");
            sb.append(cellPadding == null ? "" : " cellpadding=\"" + cellPadding + "\"");
            sb.append(bgColor == null ? "" : " bgcolor=\"" + bgColor + "\"");
            sb.append(width == null ? "" : " width=\"" + width + "\"");
            sb.append(height == null ? "" : " height=\"" + height + "\"");
            sb.append(styleClass == null ? "" : " class=\"" + styleClass + "\"");
            sb.append(style == null ? "" : " style=\"" + style + "\"");
            sb.append(borderColor == null ? "" : " bordercolor=\"" + borderColor + "\"");
            sb.append(borderColorDark == null ? "" : " bordercolordark=\"" + borderColorDark + "\"");
            sb.append(borderColorLight == null ? "" : " bordercolorlight=\"" + borderColorLight + "\"");
        } else
        if(type.toUpperCase().equals("LIST"))
        {
            sb.append(" border=0 cellspacing=1 cellpadding=2 class=ListTable width=\"100%\"");
            sb.append(style == null ? "" : " style=\"" + style + "\"");
        } else
        if(type.toUpperCase().equals("INPUT"))
        {
            sb.append(" border=0 cellspacing=1 cellpadding=2 class=InputTable width=\"100%\"");
            sb.append(style == null ? "" : " style=\"" + style + "\"");
        } else
        if(type.toUpperCase().equals("INPUT_ID"))
        {
            sb.append(" border=0 id=\"InputTable\" cellspacing=1 cellpadding=2 class=InputTable width=\"100%\"");
            sb.append(style == null ? "" : " style=\"" + style + "\"");
        } else
        if(type.toUpperCase().equals("BUTTON"))
        {
            sb.append(" border=0 cellspacing=1 cellpadding=2 class=ButtonTable width=\"100%\"");
            sb.append(style == null ? "" : " style=\"" + style + "\"");
        } else
        if(type.toUpperCase().equals("SEARCH"))
        {
            sb.append(" border=0 cellspacing=1 cellpadding=2 class=SearchTable");
            sb.append(style == null ? "" : " style=\"" + style + "\"");
        } else
        if(type.toUpperCase().equals("MEMO"))
        {
            sb.append(" border=0 cellspacing=1 cellpadding=2 class=MemoTable");
            sb.append(style == null ? "" : " style=\"" + style + "\"");
        } else
        {
            sb.append("");
        }
        sb.append(">");
        ResponseUtils.write(pageContext, sb.toString());
        return 1;
    }

    public int doEndTag()
        throws JspException
    {
        ResponseUtils.write(pageContext, "</table>");
        if(type != null && !type.toUpperCase().equals("LIST") && !type.toUpperCase().equals("INPUT") && !type.toUpperCase().equals("BUTTON") && !type.toUpperCase().equals("SEARCH"))
            type.toUpperCase().equals("MEMO");
        return 6;
    }
}
